package cn.fbs.dao.dm;

import cn.fbs.model.NewTCodeTargetType;
import cn.fbs.model.NewTcodeTargetTree;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DMNewTargetMapper {


    List<NewTcodeTargetTree> getFirstLevel();


    List<NewTcodeTargetTree> getChildrens(@Param("length") int length, @Param("xh") String xh);

    void insert(NewTCodeTargetType targetType);

    void update(NewTCodeTargetType targetType);

    int selectCountByXH(@Param("length") int length, @Param("xh") String xh);

    void delete(@Param("xh") String xh);

    String getMaxTarget(@Param("xh") String xh);

    List<NewTCodeTargetType> getTargetByMC(String mc);

    List<NewTcodeTargetTree> selectAll();

    NewTCodeTargetType selectByPrimaryKey(String zbnm);

    String queryNameByXh(String xh);

    String selectIdByTargetName(String targetName);

    String getXh(@Param("zbnm") String zbnm);

    String getTargetByNm(@Param("zbnm") String zbnm);

    //找到当前目标下的所有子目标
    List<NewTCodeTargetType> getCurrentChildrens(@Param("xh") String xh);

    NewTCodeTargetType getByNm(String zbnm);

    void deleteAll();

    int selectCountByname(@Param("mc") String mc,@Param("zbnm") String zbnm);


    String getSubMaxTarget(@Param("xh")String xh);

    NewTCodeTargetType getOneTargetByMC(@Param("mc")String mc);

    List<NewTcodeTargetTree> getBelongMeTarget(@Param("idsStr") String idsStr,
                                               @Param("likeStr") String likeStr,
                                               @Param("pidStr") String pidStr
                                               );

    List<NewTcodeTargetTree> getBelongMeTargetByLike(@Param("likeStr") String likeStr);

    List<NewTcodeTargetTree> getBelongMeTargetByIds(@Param("idsStr") String idsStr);

    List<NewTcodeTargetTree> getBelongMeTargetByPid(
                                               @Param("pidStr") String pidStr);

    List<NewTCodeTargetType> getByXh(@Param("idsStr")String idsStr);
}
